﻿#ifndef SAVETHREAD_H
#define SAVETHREAD_H

#include <QThread>
#include <QList>
#include <QStringList>
#include <QMutex>
#include <opencv2/opencv.hpp>

#pragma execution_character_set("utf-8")

#include "fsConfig.h"

class SaveThread : public QThread
{
    Q_OBJECT

public:
    explicit SaveThread(QObject *parent = nullptr,fsConfig *conf = nullptr, const QString curDir = "");
    // ~SaveThread();

    fsConfig *fsConf;

    int threadId;
    QString curPath;
    int curFileNum;

    void stop(void);
    int getImageList(void);
    int getLogList(void);
    void AddImg(const cv::Mat img);
    void AddLog(const QString msg);

public:
    void run() override;

signals:
    void threadExit(void);
    void saveFile(QString);

private:
    // void saveMat(void);

private:
    // QMutex *queueMutex;
    bool isExit;
    QList<cv::Mat>  saveImgList;
    QStringList     saveLogList;

};

#endif // SAVETHREAD_H
